package org.itsolutions.javaBackup.gui.web.common.components;

import org.itsolutions.javaBackup.gui.web.common.ApplicationDataHolder;

import com.google.inject.Inject;
import com.vaadin.ui.Accordion;

/**
 * Localized vaadin accordion. 
 * @author Tomas Fecko
 */
public class JBAccordion extends Accordion {

	private static final long 		serialVersionUID = 1806460358952527420L;
	@Inject ApplicationDataHolder	mAppHolder;
    
	@Override
	public final String getCaption() {
		String caption = super.getCaption();
		if (caption != null && !caption.isEmpty()) {
			return mAppHolder.getString(caption);
		} else {
			return null;
		}
	}

	@Override
	public final String getDescription() {
		String desc = super.getDescription();
		if (desc != null && !desc.isEmpty() && mAppHolder != null) {
			return mAppHolder.getString(desc);
		} else {
			return null;
		}
	}
}





